<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="VoucherContable.aspx.cs" Inherits="Contabilidad_IngresoVoucher" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="contenido" Runat="Server">
    <asp:Panel ID="pnlMantenedorVoucher" runat="server" GroupingText="Ingreso de Voucher Contable"
        Height="100%">
<script language="javascript" type="text/javascript">
function intOnly(i) 
{
if(i.value.length>0) 
{
i.value = i.value.replace(/[^\d]+/g, ''); 
}
}
</script>        
    <table>
        <tr>
            <td style="width: 100px; text-align: right">
                Voucher Nro. :</td>
            <td style="width: 100px; text-align: left">
                <asp:TextBox ID="txbVoucher" runat="server"></asp:TextBox></td>
            <td style="width: 100px; text-align: right">
                Fecha :</td>
            <td style="width: 100px; text-align: left">
                <asp:TextBox ID="txbFecha" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td style="width: 100px; text-align: right">
                Cuenta :</td>
            <td colspan="2" style="text-align: right">
                <asp:DropDownList ID="ddlCuenta" runat="server" DataSourceID="odsPlanDeCuenta"
                    DataTextField="Nombre" DataValueField="Id" Width="100%">
                </asp:DropDownList></td>
            <td style="width: 100px; text-align: left">
            </td>
        </tr>
        <tr>
            <td style="width: 100px; text-align: right">
                Debe :</td>
            <td style="width: 100px; text-align: left">
                <asp:TextBox ID="txbDebe" runat="server" onChange="intOnly(this);" onKeyUp="intOnly(this);" onKeyPress="intOnly(this);"></asp:TextBox></td>
            <td style="width: 100px; text-align: right">
                Haber :</td>
            <td style="width: 100px; text-align: left">
                <asp:TextBox ID="txbHaber" runat="server" onChange="intOnly(this);" onKeyUp="intOnly(this);" onKeyPress="intOnly(this);"></asp:TextBox></td>
        </tr>
        <tr>
            <td style="width: 100px; text-align: right">
                Glosa :</td>
            <td colspan="4" style="width: 100px; text-align: left">
                <asp:TextBox ID="txbGlosa" runat="server" Width="392px"></asp:TextBox></td>
        </tr>
        <tr>
            <td colspan="4">
                <br />
        <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" OnClick="btnCancelar_Click" CssClass="botonCancelar" /><asp:Button ID="btnEliminar" runat="server" Text="Eliminar" OnClick="btnEliminar_Click" CssClass="botonEliminar" /><asp:Button ID="btnModificar" runat="server" Text="Modificar" OnClick="btnModificar_Click" CssClass="botonModificar" /><asp:Button ID="btnNuevo"
            runat="server" Text="Nuevo" OnClick="btnNuevo_Click" CssClass="botonAceptar" /><asp:Button ID="btnAceptar" runat="server" Text="Aceptar" OnClick="btnAceptar_Click" CssClass="botonNuevo" /></td>
        </tr>
        <tr>
            <td colspan="4">
                <br />
                <hr />
                &nbsp;</td>
        </tr>
        <tr>
            <td colspan="4">
    <asp:GridView ID="gdvVoucher" CssClass="GridViewStyle" runat="server" AutoGenerateColumns="False" DataSourceID="odsVoucher" DataKeyNames="Id" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" AllowPaging="True" Width="100%">
        <Columns>
            <asp:TemplateField HeaderText="Cuenta" SortExpression="Cuenta">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Cuenta") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Cuenta.Nombre") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Debe" SortExpression="Debe">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Debe") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Debe") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Haber" SortExpression="Haber">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Haber") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("Haber") %>'></asp:Label>
                </ItemTemplate>
                <ItemStyle HorizontalAlign="Left" />
            </asp:TemplateField>
            <asp:CommandField ShowSelectButton="True" />
        </Columns>
        <RowStyle CssClass="RowStyle" />
        <PagerStyle CssClass="PagerStyle" />
        <HeaderStyle CssClass="HeaderStyle" />
        <AlternatingRowStyle CssClass="AltRowStyle" />
        <SelectedRowStyle CssClass="SelectedRowStyle" />
    </asp:GridView>
            </td>
        </tr>
    </table>
        <br />
        <br />
        <br />
    </asp:Panel>
    &nbsp;
    <asp:ObjectDataSource ID="odsVoucher" runat="server" DataObjectTypeName="EYDIngenieria.ERP.ObjetosDeNegocio.Dominio.Voucher"
        DeleteMethod="Eliminar" InsertMethod="Agregar" SelectMethod="Listar" TypeName="EYDIngenieria.ERP.Aplicacion.Contabilidad.IngresoVoucher"
        UpdateMethod="Modificar"></asp:ObjectDataSource>
        
    <asp:ObjectDataSource ID="odsPlanDeCuenta" runat="server" DataObjectTypeName="EYDIngenieria.ERP.ObjetosDeNegocio.Dominio.PlanDeCuenta"
        DeleteMethod="Eliminar" InsertMethod="Agregar" SelectMethod="Listar" TypeName="EYDIngenieria.ERP.Aplicacion.Mantenedores.MantenedorPlanDeCuenta"
        UpdateMethod="Modificar"></asp:ObjectDataSource>
    <br />
    <br />
    <br />
</asp:Content>

